package simpleapplications;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class JavaAwtDimension {
	public static void main(String[] args) {
		try {
			Class<?> c = Class.forName("java.awt.Dimension");
			System.out.println("Constructors:");
			Constructor<?> constructors[] = c.getConstructors();//获取该类的构造方法数组
			for (int i = 0; i < constructors.length; i++) {
				System.out.println(" " + constructors[i]);
			}
			System.out.println("Fields:");
			Field fields[] = c.getFields();//获取该类的字段数组
			for (int i = 0; i < fields.length; i++) {
				System.out.println(" " + fields[i]);
			}
			System.out.println("Methods:");
			Method methods[] = c.getMethods();//获取该类的方法数组
			for (int i = 0; i < methods.length; i++) {
				System.out.println(" " + methods[i]);
			}
		} catch (ClassNotFoundException e) {
			System.out.println("Exception:" + e);
		}
	}
}
